package hust.music.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import hust.music.action.base.ActionBase;
import hust.music.service.MusicModService;

/**
 * MusicMarkAction
 * 
 * @author Txazo
 * @since 1.0
 */
@Controller
@Scope("session")
public class MusicMarkAction extends ActionBase {

	private static final long serialVersionUID = 1L;

	/** 歌曲Id */
	private Integer id;
	/** 收听量 */
	private int listen;
	/** 评分 */
	private int mark;

	@Autowired
	private MusicModService musicModService;

	/**
	 * 收听
	 * 
	 * @return 逻辑视图
	 */
	public String listen() {
		listen = musicModService.addListen(id);

		return "listen";
	}

	/**
	 * 评分
	 * 
	 * @return 逻辑视图
	 */
	public String mark() {
		System.out.println(mark);
		mark = musicModService.mark(id, mark);

		return "mark";
	}

	public int getListen() {
		return listen;
	}

	public void setListen(int listen) {
		this.listen = listen;
	}

	public int getMark() {
		return mark;
	}

	public void setMark(int mark) {
		this.mark = mark;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

}
